package com.cntcdt.api.service;

import java.util.List;

import com.cntcdt.api.db.model.AddLineUserDeviceModel;

public interface AddLineUserDeviceService {
	/**
	 * 根据用户id查询数据
	 * 
	 * @param userId
	 * @return
	 */
	public List<AddLineUserDeviceModel> findByUserId(int userId);

	/**
	 * 根据用户id分页查询
	 * 
	 * @param userId
	 * @param sortTime
	 * @return
	 */
	public List<AddLineUserDeviceModel> findByUserIdAndSortTime(int userId, int sortTime);

	/**
	 * 插入一条数据
	 * 
	 * @param addLineUserDevice
	 * @return
	 */
	public int insertModel(AddLineUserDeviceModel addLineUserDevice);

	/**
	 * 根据用户id和设备号查询
	 * 
	 * @param userId
	 * @param terminal
	 * @return
	 */
	public AddLineUserDeviceModel findByUserIdAndTerminal(int userId, String terminal);

	/**
	 * 根据id查询数据
	 * 
	 * @param addLineUserDeviceId
	 * @return
	 */
	public AddLineUserDeviceModel findById(int addLineUserDeviceId);

	/**
	 * 更新一条数据
	 * 
	 * @param addLineUserDevice
	 * @return
	 */
	public boolean updateModel(AddLineUserDeviceModel addLineUserDevice);

	/**
	 * 根据设备号查询数据
	 * 
	 * @param terminal
	 * @return
	 */
	public List<AddLineUserDeviceModel> findByTerminal(String terminal);

	/**
	 * 根据分组id和设备号查询
	 * 
	 * @param groupId
	 * @param terminal
	 * @return
	 */
	public AddLineUserDeviceModel findByGroupIdAndTerminal(int groupId, String terminal);

	/**
	 * 根据设备号查询分组数据
	 * 
	 * @param terminal
	 * @return
	 */
	public List<AddLineUserDeviceModel> findByTerminalAndType(String terminal);
	
	/**
	 * 
	 * @param terminal
	 * @param adminUserGroupId
	 * @return
	 */
	public List<AddLineUserDeviceModel> findByTerminalAndAdminUserGroupId(String terminal, int adminUserGroupId);
	
	/**
	 * 记录是否存在
	 * @param terminal
	 * @param addLineUserId
	 * @return
	 */
	public boolean isExistRecord(String terminal);
}
